package dk.pun.dums.shared.character;

public class GenerationBonus {
	
	public static final GenerationBonus[] BONUSES = new GenerationBonus[] {
		new GenerationBonus(1, 1, 2, 1, 10, 1),
		new GenerationBonus(2, 2, 3, 2, 10, 1),
		new GenerationBonus(3, 3, 4, 3, 10, 1),
		new GenerationBonus(4, 4, 5, 6, 10, 2),
		new GenerationBonus(5, 5, 8, 8, 10, 2),
		new GenerationBonus(6, 6, 10, 12, 12, 3),
		new GenerationBonus(7, 7, 12, 16, 14, 3),
		new GenerationBonus(8, 8, 15, 22, 16, 4),
		new GenerationBonus(9, 9, 17, 28, 18, 4),
		new GenerationBonus(10, 10, 20, 36, 20, 5)
	};
	
	public static GenerationBonus getGenerationBonus(final int generationBonus) {
		if (generationBonus < 1 || generationBonus > 10) {
			throw new IllegalArgumentException("Illegal generation bonus: " + generationBonus + ". Generation bonus must be 1-10.");
		}
		return GenerationBonus.BONUSES[generationBonus-1];
	}
	
	private final transient int generation;
	private final transient int magicalTalents;
	private final transient int supernaturalAdvantages;
	private final transient int disciplines;
	private final transient int maxBlood;
	private final transient int bloodPerFight;
	
	public GenerationBonus(final int generation, final int talents, final int advantages, final int disciplines, final int maxBlood, final int bloodPerFight) {
		this.generation = generation;
		this.magicalTalents = talents;
		this.supernaturalAdvantages = advantages;
		this.disciplines = disciplines;
		this.maxBlood = maxBlood;
		this.bloodPerFight = bloodPerFight;
	}

	public int getGeneration() {
		return generation;
	}

	public int getMagicalTalents() {
		return magicalTalents;
	}

	public int getSupernaturalAdvantages() {
		return supernaturalAdvantages;
	}

	public int getDisciplines() {
		return disciplines;
	}

	public int getMaxBlood() {
		return maxBlood;
	}

	public int getBloodPerFight() {
		return bloodPerFight;
	}

}
